<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>    
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>
<body>
    <div id="app">
       <!-- <blog-post post-title="绑定静态属性"></blog-post> -->
       <blog-post :post-title="title"></blog-post>
    </div>
    
    <script>
        Vue.component("blog-post",{
            // 标签里面的attr只能小写 不区分大小写
            // 组件中的props作为js合法变量解析是要区分大小写
            // attr里面的横杠分割单词在props中对应小驼峰的写法
            props:["postTitle"],
            template:`
            <div>
                <p>{{postTitle}}</p>
            </div>
            
            `
        })

        new Vue({
            el:"#app",
            data:{
                title:"父组件值传入子组件"
            }
        });
    
    </script>
</body>
</html>